/**
* @Description:    t-tree
* @Author:         TSY
* @CreateDate:     2018/9/5 9:04
* @email:          t@tsy6.com
*/
<template>
    <div class="content">
        <ul>
            <li v-for="(item,index) in treeData" :key="index">
                <ul>
                    <li v-for="(parent,i) in item.child" :key="index+i">
                        <tree-item :label="parent.title" :text="parent.number+'次'" :is-parent="parent.isParent"
                                    :is-click="parent.isClick" @click="$emit('itemClick',parent)">
                            <ul>
                                <li v-for="(child,j) in parent.child" :key="index+i+j">
                                    <tree-item :label="child.title" :text="child.number+'次'"
                                                :is-click="child.isClick"
                                               @click="$emit('itemClick',child)"></tree-item>
                                </li>
                            </ul>
                        </tree-item>
                    </li>
                </ul>
            </li>
        </ul>
    </div>
</template>

<script>

    import TreeItem from "./TreeItem";
    export default {
        name: "tTree",
        components: {TreeItem},
        props: {
            treeData: {
                type: Array,
                default() {
                    return []
                }
            }
        },
        data() {
            return {

            }
        },
        mounted() {

        },
        methods: {

        }
    }
</script>

<style lang="stylus" scoped>
    @import "./style/common.styl"

    .title {
        width 100%
        background bg-color
        fontSize(28px)
        color vice-font-color
        paddingSmall()
    }
</style>
